{extend name="common" /}
{block name='content'}
<div class="padding-big background-color">

    <!-- TAB NAVIGATION -->
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="">商品列表</a></li>
        <li ><a href="{:url('admin/goods/create')}">添加/编辑</a></li>
    </ul>
    <hr>

    <table class="table table-hover">
        <thead>
        <tr>
            <th width="60">id</th>
            <th>商品名称</th>
            <th>商品价格</th>
            <th>参考价格</th>
            <th>点击量</th>
            <th>预览图</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name='data' item='v'}
            <tr>
                <td style="line-height: 60px;">{$v['gid']}</td>
                <td style="line-height: 60px;">{$v['gname']}</td>
                <td style="line-height: 60px;">{$v['gprice']}</td>
                <td style="line-height: 60px;">{$v['mprice']}</td>
                <td style="line-height: 60px;">{$v['click']}</td>
                <td style="line-height: 60px;">
                    <img src="{$v['cover']}" alt="" width="80">
                </td>
                <td style="line-height: 60px;">
                    <a href="{:url('admin/goods/edit',['id'=>$v['gid']])}" class="btn btn-primary btn-xs">编辑</a>
                    <a href='javascript:if(confirm("确定删除吗？")) location.href="{:url('admin/goods/delete',['id'=>$v['gid']])}";' class="btn btn-danger btn-xs">删除</a>
                </td>
            </tr>
        {/foreach}
        </tbody>
    </table>
</div>
{/block}